<?xml version="1.0" encoding="utf-8"?> 
<%@ page language="java" contentType="text/html; charset=utf-8" 
pageEncoding="utf-8"%> 
<%@ page import="java.util.*"%> 
<%@ page import = "com.tomato.dao.PMF" %>
<%@ page import = "ebook.server.Member" %>
<%@ page import = "javax.jdo.PersistenceManager" %>
<%@ page import = "javax.jdo.Query" %>
<%@ page import = "java.util.List" %>
<%@ page import = "javax.jdo.Transaction" %>

<% 

String email = request.getParameter("email"); 
String pass = request.getParameter("pass"); 
String book = "xx";

int result = -1; 
int result1 = 0; 

PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(Member.class);
query.setFilter("email == emailParam");
query.declareParameters("String emailParam");
Member emp = new Member(email,pass);
@SuppressWarnings("unchecked")
List<Member> empData = (List<Member>)query.execute(email);
	if(empData.isEmpty()){
		result = 1;
		pm.makePersistent(emp);
		pm.close();
		
	}
	else{
		result = 0;
		pm.close();
	}


%> 
<lists> 
<%if(result==0){ %> 
<data> 
<rowid>2</rowid> 
<msg>중복아이디가 있습니다</msg> 
</data> 
<%}else if(result == -1){ %> 

<%}else{ %> 
<data> 
<rowid>1</rowid> 
<msg>가입성공하셧슴</msg> 
<book><%=book%></book>
<level>1</level> 
<id></id> 
<pwd><%=pass%></pwd> 
<email><%=email%></email> 

</data> 
<%} %> 
</lists> 